package com.guoxin.mashibing.concurrent;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.stream.IntStream;

public class ArrayBlockingQueueTest {

    static ArrayBlockingQueue<String> strs = new ArrayBlockingQueue<>(10);

    public static void main(String[] args) throws InterruptedException {
        IntStream.range(0,10).forEach(i->{
            try {
                strs.put("a"+i);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });

//        strs.add("ass");
//        strs.offer("ass");
        strs.put("ass");
        System.out.println(strs);
    }
}
